//
//  MTUserListCell.m
//  MeToo
//
//  Created by 俊松何 on 2018/7/12.
//  Copyright © 2018年 tianxie. All rights reserved.
//

#import "MTUserListCell.h"

@interface MTUserListCell()
@property (weak, nonatomic) IBOutlet UIImageView *headerImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLable;
@property (weak, nonatomic) IBOutlet UIButton *stateLable;

@end

@implementation MTUserListCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    _headerImageView.layer.cornerRadius = 25;
    _headerImageView.layer.masksToBounds = YES;
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setIsFollow:(BOOL)isFollow
{
    _isFollow = isFollow;
    if(_isFollow)
    {
        [self.stateLable setTitle:@"已关注" forState:UIControlStateNormal];
    }else
    {
        [self.stateLable setTitle:@"关注" forState:UIControlStateNormal];
    }
    
    
    
}

-(void)setUser:(MTUserModel *)user
{
    _user = user;
    [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:_user.avatar] placeholderImage:nil];
    self.nameLable.text = user.name;
    
}

@end
